/**
 * 首页展示。container控件加载入口。
 */
import React from "react";
import { createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import reducer from "../reducers";
let AppContainer: any = null;
const applyMiddlewareTrunk = applyMiddleware(thunk);
const createStoreWithMiddleware = applyMiddlewareTrunk(createStore as any);

export default class Container extends React.Component {
  store = createStoreWithMiddleware(reducer);

  constructor(props: any) {
    super(props);
  }

  render() {
    if (!AppContainer) {
      AppContainer = require("./PayContainer").default;
    }
    return <AppContainer store={this.store} {...this.props} />;
  }
}
